; Options - this adds a graphical option near the "assemble" button that the user can select before assembly. optionsize 90 ; We don't need extra room, but show the option in the Zeus panel rather than the options tab TestType optionlist 10,0,"Type of test?","Int","Str","Float" ; Give the user the choice ; Get the value switch TestType case 0: NumVal optionint 10,30,"Numeric value?",0 endcase case 1: StrIndex optionlist 10,30,"String Entry?","Hello","Goodbye","Baah" switch StrIndex case 0:StrVal="Hello":endcase case 1:StrVal="Goodbye":endcase case 2:StrVal="Baah":endcase endswitch endcase case 2: FltVal optionfloat 10,30,"Floating point value?",1.0 endcase endswitch ; Now, test the switch statement switch TestType case 0: // Integer test switch NumVal case 0 zeusprint "Case 0" endcase case 1 zeusprint "Case 1" endcase case 2 .. 8 zeusprint "Case 2 .. 8" endcase ; case "Hello" ; zeusprint "Hello!" ; endcase default zeusprint "default case in integer" endswitch endcase case 1: // String test switch StrVal case "Hello" zeusprint "Case Hello" endcase case "Goodbye" zeusprint "Case Goodbye" endcase ; case 2 .. 8 ; zeusprint "Case 2 .. 8" ; endcase default zeusprint "default case in string" endswitch endcase case 2: // Floating point test switch FltVal case 0.0 zeusprint "Case 0.0" endcase case 1.123455 .. 1.123457 zeusprint "Case 1.123456-ish" endcase case 2.0 .. 8.0 zeusprint "Case 2.0 .. 8.0" endcase default zeusprint "default case in floating point" endswitch endcase default zeusprint "Test code for this case is not yet defined!" endswitch